<%@ include file="/common/taglibs.jsp"%>
<%@ page language="java" pageEncoding="utf8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title></title>
		<link rel="stylesheet" href="<c:url value="/css/shopadmin.css"/>" type="text/css" />
	</head>
	<body id="shopadmin">
		<div class="container" style="visibility: visible;">
			<div class="header" id="header">
				<div class="hd1">
					<h1 id="logo" class="shopname">
						<a href="" id="shop_title_block">${mallParameter.mallName.data}</a>
					</h1>
					<div id="msgRunner" style="visibility: hidden;">
						<div style="visibility: visible;" class="runner">
							<span>欢迎登陆</span> 
						</div>
					</div>
					<div class="top-link-menu">
						<div>
							<a href="" target="_blank">帮助</a>&nbsp;&nbsp;
						</div>
					</div>
				</div>
				<div class="hd2">
					<div id="mainMenus" class="top-menu">

						<c:forEach var="list" items="${systemActions}">
							<a actionId="${list.actionId}" href="#" onclick="getAction(this)" id="gd_${list.actionId}" class="tab"><span><span>${list.actionName}</span> </span> </a>
						</c:forEach>
						<a href="<c:url value="/"  />" target="_blank" id="nav_view_mall" style="margin-left: 25px;" class="tab greenbutton"><span><span>浏览商城</span> </span> </a>

					</div>
					<div class="top-link clearfix">
						<div class="span-auto user-name">
							您 好,${systemAdminUser.name}
						</div>
						<div class="span-auto">
							[&nbsp;
							<a target="_blank" href="sys_admin_editPassword.do">帐号设置</a>&nbsp;]
						</div>
						<div class="span-auto">
							[&nbsp;
							<a href="<c:url value="/logout.jsp" />" target="_top">退出</a>&nbsp;]
						</div> 
						<div class="span-auto">
							<a href="">关于</a>
						</div>
					</div>
				</div>
			</div>
			<div id="sidecontent">

				<c:forEach var="top" items="${systemActions}">
					<c:set value="0" var="first" />
					<div style="display: none;" id="ad_menu_${top.actionId}">
						<c:forEach var="secAct" items="${top.subActions}">

							<div>
								<div class="g-level-1 g-level-1-withchild">
									<span class="title">${secAct.actionName}</span>
								</div>
								<div id="m_d_0" class="g-level-2">
									<c:forEach var="thirdAct" items="${secAct.subActions}">
										<a href="#" <c:if test="${first==0}">
										<c:set value="1" var="first"  />  
										 id="default_first_${top.actionId}"  url="${thirdAct.actionUrl}"
										</c:if>
											onclick='show(this,"${thirdAct.actionUrl}");'>${thirdAct.actionName}</a>
									</c:forEach>
								</div>

							</div>
						</c:forEach>
					</div>
				</c:forEach>




			</div>
			<div id="leftToggler" class="toggle-bar">
				<div class="left-toggler">
					&nbsp;
				</div>
			</div>
			<div id="workground">
				<iframe name="mainFrame" id="mainFrameId" src="sys_admin_desktop.do" frameborder="0" scrolling="no" width="100%" height="100%"
					onLoad="setAutoHeight(document.getElementById('mainFrameId'), window.frames[0]);"></iframe>
			</div>
		</div>
		<div id="shopkits-pannel" class="close">
			<div class="ctlTools">
				&nbsp;
			</div>
		</div>



		<script type="text/javascript" src="<c:url value='/scripts/jquery-1.4.2.js'/>"></script>

		<script language="javascript">
	$("body").attr("class", "closeLeft");
	var hei = $("body").height() - $("#header").height();
	$("#sidecontent").height(hei);
	$("#mainFrameId").height(hei);
	$("#leftToggler").height(hei);

	var begin = true;
	function show(obj, url) {
		$("#sidecontent > div  > div > div >a").each(function(index, domEle) {
			$(domEle).attr("class", "");
		});
		$(obj).attr("class", "cur");
		window.mainFrame.location = url;
	}

	function setAutoHeight(iframeElement, iframeWindow) {

		var hhh = iframeWindow.document.body.scrollHeight;
		var www = iframeWindow.document.body.scrollWidth;

		iframeElement.style.height = $("#sidecontent").height() + "px";
		iframeElement.style.width = www + "px";

		var headBarHeight = $("#mainFrameId").contents().find("#headBar").height();
		var footBarHeight = $("#mainFrameId").contents().find("#footBar").height();
		var hei = $("#sidecontent").height() - headBarHeight - footBarHeight;
		$("#mainFrameId").contents().find("#main").height(hei - 8);

		if (begin) {
			begin = false;
		} else {
			var width = $("body").width() - $("#sidecontent").width()- $("#leftToggler").width();
			$("#mainFrameId").width(width);
		}

	}

	function getAction(act) {
		$("body").attr("class", "");
		$("#mainMenus > a").each(function(index, domEle) {
			$(domEle).attr("class", "tab");
		});
		$(act).attr("class", "tab current");
		$('#nav_view_mall').attr("class", "tab greenbutton");

		showAction(act);

	}

	function showAction(obj) {
		var sub = "ad_menu_" + $(obj).attr("actionId");
		$("#sidecontent > div").each(function(index, domEle) {
			$(domEle).attr("style", "display:none;");
		});
		$("#" + sub).attr("style", "");
		var def_id = "default_first_" + $(obj).attr("actionId");
		var url = $("#" + def_id).attr("url");
		show($("#" + def_id), url);

	}
</script>




	</body>
</html>
